const AJAX = getApp().ajax,
      $wx = getApp().$wx,
      getColor = getApp().globalData.getColor;

Page({
  data: {

  },

  onLoad(options){
    $wx.setNavColor(getColor().val);
    this.setData({
      shopsInforationImgs: JSON.parse(options.shops_information_img)
    });
  },

  onShareAppMessage(){
    
  },

  // 预览图片
  viewImg(e){
    let index = e.currentTarget.dataset.index,
        imgs = e.currentTarget.dataset.imgs,
        preview_imgs = [];

    imgs.forEach(item =>{
      preview_imgs.push(item.image);
    });

    wx.previewImage({
      current: preview_imgs[index],
      urls: preview_imgs,
      fail(res) {
        $wx.showToast(res.msg);
      }
    });
  }
});